﻿namespace DiffuseEnjoyIdle.Core.Helper
{
    public static class PathTool
    {
        public static string GetConfigPath(string path, string cfgDirName = "config")
        {
            do
            {
                string text = Path.Combine(path, cfgDirName);
                if (Directory.Exists(text))
                {
                    return text;
                }

                path = Path.GetDirectoryName(path);
            }
            while (!string.IsNullOrEmpty(path));
            return string.Empty;
        }
    }
}
